package com.hns.can.common.domain;

import java.util.List;

import com.hns.frame.mybatis.Pagination;

/**
 * @版权：HNS 版权所有 (c) 2013
 * @author:Fisher
 * @version Revision 1.0.0
 * @email:zhuangcaijin@126.com
 * @see:
 * @创建日期：2014-4-12
 * @功能说明：JQGrid的分页实体
 * @begin
 * @修改记录:
 * @修改后版本          修改人      	修改内容
 * @2014-4-12  	         Fisher        	创建
 * @end
 */
public class GridPage {
    
    private int          total     = 0; // 记录总数
                                         
    private int          pageSize  = 10; // 每页显示记录数
                                         
    private int          records = 0; // 总页数
                                         
    private int          page      = 1; // 当前页数
    
    private List<Object> rows;
    
    public int getTotal() {
        return total;
    }

    public int getPageSize() {
        return pageSize;
    }

    public int getRecords() {
        return records;
    }

    public int getPage() {
        return page;
    }

    public List<Object> getRows() {
        return rows;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public void setRecords(int records) {
        this.records = records;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public void setRows(List<Object> rows) {
        this.rows = rows;
    }

    public GridPage(Pagination pageination){
        if(pageination != null){
            this.page = pageination.getRowBounds().getPageNumber();
            this.pageSize = pageination.getRowBounds().getLimit();
            this.total = pageination.getPageTotal();
            this.records = pageination.getTotal();
            this.rows = pageination.getData();
        }
    }
}
